//
//  UserfulPhoneTwoCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/6/14.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "UserfulPhoneTwoCell.h"

@implementation UserfulPhoneTwoCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        
        _firstLab= [[UILabel alloc] init];
        _firstLab.text = @"客户姓名呀 :";
        _firstLab.font = [UIFont systemFontOfSize:14];
        _firstLab.textColor =[UIColor blackColor];
        [self addSubview:_firstLab];
        [_firstLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(90, 18));
            make.top.equalTo(self.mas_top).offset(15);
            make.left.equalTo(self.mas_left).offset(8);
        }];
        
        
        _oneTF = [[UITextField alloc] init];
        _oneTF.borderStyle = UITextBorderStyleRoundedRect;
        //设置输入框的背景颜色
        _oneTF.delegate = self;
        _oneTF.tag = self.tag;
        _oneTF.backgroundColor = [UIColor whiteColor];
        _oneTF.font = [UIFont systemFontOfSize:14];
        _oneTF.textColor = [UIColor blackColor];
        [self addSubview:_oneTF];
        [_oneTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(200, 30));
            make.top.equalTo(self.mas_top).offset(10);
            make.left.equalTo(self.mas_left).offset(105);
        }];
        
        
    }
    
    
    return self;
}



-(void)setPhoneheadStr:(NSString*)head andDetail:(NSString *)detail andModel:(AddMModel*)model{
    
    
    // NSLog(@"调用了这个方法%ld",_oneTF.tag);
    
    if (_oneTF.tag == 1) {
        if (model.xingming.length>0) {
            _oneTF.text = model.xingming;
        }
        
    }else if (_oneTF.tag == 2){
        if (model.fangshi.length>0) {
            _oneTF.text = model.fangshi;
        }
        
        
    }
 
    else if(_oneTF.tag == 8){
        if (model.tuiming.length>0) {
            _oneTF.text = model.tuiming;
        }
    }else if(_oneTF.tag == 9){
        if (model.tuidianhua.length>0) {
            _oneTF.text = model.tuidianhua;
        }
    }
    else if(_oneTF.tag == 13){
        _oneTF.text = model.baimiao;
    }else{
        _oneTF.text = nil;
    }
}

-(void)textViewDidBeginEditing:(UITextView *)textView{
    
    if (self.textViewBlock) {
        self.textViewBlock();
    }
    
}







- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
